<%--
  Created by IntelliJ IDEA.
  User: 17400
  Date: 2023/6/15
  Time: 16:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<head>
    <style>
        .user-nav {
            display: flex;
            align-items: center;
            padding: 1em;
            background-color: #f3f3f3;
        }
        .user-nav span, .user-nav a {
            margin-right: 1em;
            color: #007BFF;
            text-decoration: none;
        }
        .user-nav a:last-child {
            margin-right: 0;
        }
        .user-nav .flex-grow {
            flex-grow: 1;
        }
        .user-nav .home-link {
            margin-right: auto;
        }
    </style>
</head>
<body>
<div class="user-nav">
    <a class="home-link" href="/">回到首页</a>
    <div class="flex-grow"></div>
    <c:if test="${user != null}">
        <span>欢迎，${user.nickname}</span>
        <a href="logout">退出</a>
    </c:if>
    <c:if test="${user == null}">
        <a href="login-pre">登录</a>
        <a href="register-pre">注册</a>
    </c:if>
</div>
<hr style="margin-top: 0;"/>
</body>
</html>
